import requestMeeting from '@/plugins/axios'
import { SelectInfoEntity, SelectViewParamsEntity } from './interface'
/**
 *
 * @param meeting_id 会议的meetingMoid
 * @returns 获取选看信息
 */
export const fetchGetSelectViewInfo = async (meeting_id: string) =>
	requestMeeting<Array<SelectInfoEntity>>({
		url: `/mcc/${meeting_id}/select_view`,
		method: 'GET',
	}).then((res) => res)
/**
 *
 * @param meeting_id 会议的meetingMoid
 * @param params 删除选看入参
 * @returns 结束选看
 */
export const fetchStopSelectView = async (meeting_id: string, params: SelectViewParamsEntity) =>
	requestMeeting({
		url: `/mcc/${meeting_id}/select_view`,
		method: 'DELETE',
		data: params,
	}).then((res) => res.success)
/**
 *
 * @param meeting_id 会议的meetingMoid
 * @returns 停止所有选看
 */
export const fetchStopAllSelectView = async (meeting_id: string) =>
	requestMeeting({
		url: `/mcc/${meeting_id}/select_view/all`,
		method: 'DELETE',
		data: {},
	}).then((res) => res.success)
/**
 * @param meeting_id 会议的meetingMoid
 * @returns 开始选看
 */
export const fetchStartSelectView = async (meeting_id: string, params: SelectViewParamsEntity) =>
	requestMeeting({
		url: `/mcc/${meeting_id}/select_view`,
		method: 'POST',
		data: params,
	}).then((res) => res)
